(function() { // store the slider in a local variable var $window = $(window), flexslider; // tiny helper function to add breakpoints function getGridSize() { return (window.innerWidth < 280) ? 1 : (window.innerWidth < 600) ? 2 : (window.innerWidth < 800) ? 2 : (window.innerWidth < 900) ? 2 : 5; } //$window.load(function() { $(window).on("load", function (e) { // Carouse2 $('#flexCarouse2').flexslider({ animation: "slide", animationLoop: false, itemWidth: 380, itemMargin: 25, minItems: 1, maxItems: 1, //slideshow: 1, move: 1, pausePlay: true, pauseText: 'Pause', playText: 'Play', controlNav: false, start: function(slider){ $('body').removeClass('loading'); if (slider.pagingCount === 1) slider.addClass('flex-centered'); } }); }); }()); //$(window).load(function(){ $(window).on("load", function (e) { // Slider $('#flexSlider').flexslider({ animation: "slide", pausePlay: true, controlNav: true, start: function(slider){ $('body').removeClass('loading'); } }); $('#flexSlider1').flexslider({ animation: "slide", controlNav: false, start: function(slider){ $('body').removeClass('loading'); } }); $('#flexSlider2').flexslider({ animation: "slide", controlNav: false, start: function(slider){ $('body').removeClass('loading'); } }); $('#contSlider1').flexslider({ animation: "swing", controlNav: false, directionNav: false, direction: "vertical", easing:'linear', prevText: " ", nextText: " ", minItems: 2, maxItems: 2, move: 2, itemMargin: 0, pausePlay: true, pauseOnHover: true, slideshowSpeed:1000, animationSpeed:10000, }); $('#contSlider2').flexslider({ animation: "slide", controlNav: false, start: function(slider){ $('body').removeClass('loading'); } }); // Carousel $('#flexCarousel').flexslider({ animation: "slide", animationLoop: false, itemWidth: 200, itemMargin: 5, minItems: 2, maxItems: 6, slideshow: 1, move: 1, pausePlay: true, pauseText: 'Pause', playText: 'Play', controlNav: false, start: function(slider){ $('body').removeClass('loading'); if (slider.pagingCount === 1) slider.addClass('flex-centered'); } }); // Carouse2 /*$('#flexCarouse2').flexslider({ animation: "slide", animationLoop: false, itemWidth: 320, itemMargin: 5, minItems: 2, maxItems: 3, slideshow: 1, move: 1, pausePlay: true, pauseText: 'Pause', playText: 'Play', controlNav: false, start: function(slider){ $('body').removeClass('loading'); if (slider.pagingCount === 1) slider.addClass('flex-centered'); } });*/ $('#flexCarousel1').flexslider({ animation: "slide", animationLoop: false, itemWidth: 168, itemMargin: 20, minItems:1, maxItems: 4, slideshow: 1, move: 1, controlNav: false, start: function(slider){ $('body').removeClass('loading'); //if (slider.pagingCount === 1) slider.addClass('flex-centered'); } }); // breaking_news // Gallery $('#galleryCarousel').flexslider({ animation: "fade", controlNav: "thumbnails", start: function(slider){ $('body').removeClass('loading'); } }); }); $(document).ready(function(){ $('figure img').ma5gallery({ preload:true }); }); $(document).ready(function(){ $('figure img').ma5gallery({ preload:true }); }); $(document).ready(function() { //Horizontal Tab $('#parentHorizontalTab').easyResponsiveTabs({ type: 'default', //Types: default, vertical, accordion width: 'auto', //auto or any width like 600px fit: true, // 100% fit in a container tabidentify: 'hor_1', // The tab groups identifier activate: function(event) { // Callback function if tab is switched var $tab = $(this); var $info = $('#nested-tabInfo'); var $name = $('span', $info); $name.text($tab.text()); $info.show(); } }); }); // ====Tab scrolling text==== function changeClass(){ var x = document.getElementsByClassName("text-slide"); var y = document.getElementsByClassName("scroll-text"); x[0].classList.toggle ("pause"); y[0].classList.toggle("scroll-left"); } function changeClass1(){ var x = document.getElementsByClassName("text-slide1"); var z = document.getElementsByClassName("scroll-text-1"); x[0].classList.toggle ("pause"); z[0].classList.toggle("scroll-left"); } // ===== Scroll to Top ==== $(document).ready(function(){ $(document).scroll(function() { if ($(this).scrollTop() > 100) { $('#scroll').fadeIn(); } else { $('#scroll').fadeOut(); } }); $('#scroll').click(function(){ $("html, body").animate({ scrollTop: 0 }, 800); return false; }); });